package com.bgds.sys.module.serviceimpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bgds.sys.common.pagevo.PageVo;
import com.bgds.sys.module.entity.DeviceFault;
import com.bgds.sys.module.mapper.DeviceFaultMapper;
import com.bgds.sys.module.service.IDeviceFaultService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lj
 * @since 2020-05-13
 */
@Service
public class IDeviceFaultServiceImpl extends ServiceImpl<DeviceFaultMapper, DeviceFault> implements IDeviceFaultService {

    @Autowired
    private DeviceFaultMapper deviceFaultMapper;
    @Override
    public IPage<DeviceFault> listByParmas(PageVo page, Long startTime,Long endTime) {

        return deviceFaultMapper.queryByDateRange(new Page<>(page.getPageNumber(),page.getPageSize()),startTime,endTime);
    }

    @Override
    public List<DeviceFault> getDviceFaults(Long startTime,Long endTime) {
        return deviceFaultMapper.listByDateRange(startTime,endTime);
    }


}
